import app
from requests_utils import RequestsUtils


class BhtApi:
    def __init__(self):
        self.req_utils = RequestsUtils()
        self.url_verify = app.BASE_URL + "/foreign/v1/sms/getSmsCode"
        self.url_login = app.BASE_URL + "/security/user/login"
        self.headers = app.HEADERS

    def get_verify(self, json):
        resp = self.req_utils.send_requests(method='post',
                                            url=self.url_verify,
                                            headers=self.headers,
                                            json=json)
        return resp

    def login(self, json):
        resp_login = self.req_utils.send_requests(method='post',
                                                  url=self.url_login,
                                                  headers=self.headers,
                                                  json=json)
        return resp_login


if __name__ == '__main__':
    user_json = {"phone": "16603100027", "scene": "APP_LOGIN"}
    headers = {
        'Content-Type': 'application/json;charset=UTF-8',

    }
    resp = BhtApi().get_verify(user_json)
    print(resp.json())
    